<template lang="html">
  <div :class="['todo-item',todo.complete ? 'complete' : '']">
    <input type="checkbox" class="checkbox" v-model="todo.complete" name="" value="">
    <label for="">{{todo.content}}</label>
    <button class="destory" @click="deleteTodo" name="button">删除</button>
  </div>
</template>

<script>
export default {
  props:{
    todo:{
      type:Object,
    required:true,    }
  },
  methods:{
    deleteTodo(){
      alert('删除')
    }
  }
}
</script>

<style lang="css">
.todo-item{
  height: 50px;
  line-height: 50px;
  padding: 20px;
  font-size: 20px;
  width: 80%;
}
.checkbox{
  width: 25px;
  height: 25px;

}
.destory{
  float: right;
  
}
.complete{
  text-decoration: line-through;
  color: #999;
  text-decoration-color: #666;
}
</style>
